// 1.Object.is 判断两个值是否完全相等
console.log(Object.is(120, 120)); // true
// 与===不同点: NaN比较
console.log(Object.is(NaN, NaN)); // true
console.log(NaN === NaN); // false


// 2.Object.assign 对象的合并
const config1 = {
  host: "localhost",
  port: 3306,
  name: "root",
  password: "root",
  test1: "test1"
}
const config2 = {
  host: "http://atguigu.com",
  port: 33044,
  name: "atguigu.com",
  password: "iloveyou",
  test2: "test2"
}
console.log(Object.assign(config1, config2)); // 两个对象中都存在的属性, 后面对象的属性覆盖前面的, 两个对象都不存在的属性直接合并进新的对象中


// 3.Object.setPrototypeOf 和 Object.getPrototypeOf
const school = {
  name: "qdreamer"
}
const cities = {
  names: ["北京", "上海", "深圳"]
}
// 设置原型
Object.setPrototypeOf(school, cities);
console.log(school);

// 获取原型
console.log(Object.getPrototypeOf(school));